<?php echo $header; ?>


<script src="catalog/view/javascript/jquery/zoom/jqzoom.pack.1.0.1.js" type="text/javascript"></script>

<link rel="stylesheet" href="catalog/view/theme/default/stylesheet/jqzoom.css" type="text/css">

<script type="text/javascript">



$(function() {

	$(".jqzoom").jqzoom({xOffset:15,zoomWidth:500,zoomHeight:375});

});

</script>

<style type="text/css">

	.options label{line-height: 25px}

	.options b{line-height: 35px;}

</style>

<?php echo $column_left; ?>

<div class="page" style="">

	<div class="inner">

		<div id="notification"></div>

		<div class="navigation">

			<?php foreach ($breadcrumbs as $breadcrumb) { ?>

				<?php echo $breadcrumb['separator']; ?>

				<a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>

			<?php } ?>

		</div>

		<div class="detail">

                <dl>

            

			<div id="bigPic" style="position: relative">

				<div class="image" style="width:240px;height:240px" >

						<a class="jqzoom" style="width:240px;height:240px;position: relative;" href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="colorbox" rel="colorbox" id="jqzoom">

							<img style="width:240px;height:240px" src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" />

						</a>

			</div>

			</div>



			<table cellspacing="0" cellpadding="0">

				<tr>

					<td>

						<img onclick="previous('smallPics')" src="catalog/view/theme/default/images/img_05.png">

					</td>

					<td width="100%" align="center" id="smallPics">

						<?php for($i=0;$i<count($images);$i++){$image=$images[$i]; ?>

							<img width="50" height="50" src="<?php echo $image['thumb']; ?>" title="<?php echo $image['popup']; ?>" alt="<?php echo $heading_title; ?>" <?php if($i>2){?>style="display: none;"<?php }?> />

						<?php } ?>

				    

					</td>

					<td>

						<img onclick="next('smallPics')" src="catalog/view/theme/default/images/img_06.png">

					</td>

				</tr>

			</table>

            </dl>

	        <div class="product-info">

	            <h3><?php echo $heading_title; ?>&nbsp;</h3>

	            <div class="description">

			        <?php if ($manufacturer) { ?>

			        <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />

			        <?php } ?>

			        <span><?php echo $text_model; ?></span> <?php echo $model; ?><br />

			        <?php if ($reward) { ?>

			        <span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />

			        <?php } ?>

			        <span><?php echo $text_stock; ?></span> <?php echo $stock; ?><br />

			        <span>Merchandise Grade : </span><img src="catalog/view/theme/default/images/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />

			   </div>

	           <?php if ($price) { ?>

					<div class="price" style="line-height:auto"><?php echo $text_price; ?>

						<?php if (!$special) { ?>

						<?php echo $price; ?>

						<?php } else { ?>

						<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>

						<?php } ?>

						<br />

						<?php if ($tax) { ?>

						<span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />

						<?php } ?>

						<?php if ($points) { ?>

						<span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br />

						<?php } ?>

						<?php if ($discounts) { ?>

						<br />

						<div class="discount">

							<table style="width:100%"><tr><td style="width:20%">Buy More<br />Save More</td><td>

						  <?php foreach ($discounts as $key=>$discount) { 

							  if($discounts[$key+1]){

								echo sprintf($text_discount, $discount['quantity'],'~'.((int)$discounts[$key+1]['quantity']-1), $discount['price']); ?>

							  <?php }else{

							  	echo sprintf($text_discount, $discount['quantity'], '+' , $discount['price']);

							  } ?>

							  <br /> 

						  <?php } ?></td></tr></table>

						</div>

						<?php } ?>

					</div>

			    <?php } ?>

	        	<?php if ($options) { ?>

			    <div class="options" style="margin-bottom:10px;">

			        <h2 style="font-size:15px"><?php echo $text_option; ?></h2>

			        <br />

			        <?php foreach ($options as $option) { ?>

			        <?php if ($option['type'] == 'select') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <select name="option[<?php echo $option['product_option_id']; ?>]">

			            <option value=""><?php echo $text_select; ?></option>

			            <?php foreach ($option['option_value'] as $option_value) { ?>

			            <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>

			            <?php if ($option_value['price']) { ?>

			            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)

			            <?php } ?>

			            </option>

			            <?php } ?>

			          </select>

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'radio') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <?php foreach ($option['option_value'] as $option_value) { ?>

			          <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />

			          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>

			            <?php if ($option_value['price']) { ?>

			            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)

			            <?php } ?>

			          </label>

			          <br />

			          <?php } ?>

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'checkbox') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <?php foreach ($option['option_value'] as $option_value) { ?>

			          <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />

			          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>

			            <?php if ($option_value['price']) { ?>

			            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)

			            <?php } ?>

			          </label>

			          <br />

			          <?php } ?>

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'image') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <table class="option-image">

			            <?php foreach ($option['option_value'] as $option_value) { ?>

			            <tr>

			              <td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>

			              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>

			              <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>

			                  <?php if ($option_value['price']) { ?>

			                  (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)

			                  <?php } ?>

			                </label></td>

			            </tr>

			            <?php } ?>

			          </table>

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'text') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'textarea') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'file') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <input type="button" value="<?php echo $button_upload; ?>" id="button-option-<?php echo $option['product_option_id']; ?>" class="button">

			          <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'date') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'datetime') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />

			        </div>

			        <br />

			        <?php } ?>

			        <?php if ($option['type'] == 'time') { ?>

			        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">

			          <?php if ($option['required']) { ?>

			          <span class="required">*</span>

			          <?php } ?>

			          <b><?php echo $option['name']; ?>:</b><br />

			          <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />

			        </div>

			        <br />

			        <?php } ?>

			        <?php } ?>

			    </div>

			    <?php } ?>

	            <table cellspacing="0" cellpadding="0">

	             	<tr>

	                <td>I want to buy : &nbsp;&nbsp;</td>

	                <td><img onclick="buy.minus('.buy','#quantity')" class="cursor_pointer" src="catalog/view/theme/default/images/img_02.png"></td>

	                <th width="50" align="center" class="buy">1</th>

	                <td><img onclick="buy.plus('.buy','#quantity')" class="cursor_pointer" src="catalog/view/theme/default/images/img_04.png">

	                </td>

	              </tr>

	            </table>

	            <div>

	            	<br />

					<input type="hidden" value=<?php echo $product_id ;?> name="product_id">

					<input type="hidden" value=1 name="quantity" id="quantity">

					<button id="button-cart"  class="cursor_pointer" style="width:132px;height:27px;background:url(catalog/view/theme/default/images/btn_02.png)"></button>

					<button onclick="addToWishList('<?php echo $product_id ;?>');"  class="cursor_pointer" style="width:23px;height:19px;background:url(catalog/view/theme/default/images/icon_07.png); margin-left:5px;"></button>

	            </div>

	            <div class="minimum"><?php echo $text_minimum; ?></div>

				<div class="share" style="line-height:normal;">

					<!-- AddThis Button BEGIN -->

					<div class="addthis_default_style" style="line-height:normal;">

						<a class="addthis_button_compact"><?php echo $text_share; ?></a> <a class="addthis_button_email"></a>

						<a class="addthis_button_print"></a> 

						<a class="addthis_button_facebook"></a> 

						<a class="addthis_button_twitter"></a>

					</div>

					<script type="text/javascript" src="//s7.addthis.com/js/250/addthis_widget.js"></script> 

					  <!-- AddThis Button END -->

				</div>

			</div>

		</div>

	<?php if($products){?>

	<div class="_panel">

		<h3>&nbsp;&nbsp;&nbsp;&nbsp;Arrange in pairs or groups</h3>

		<?php foreach ($products as $product) { ?>

			 <div>

				<a href="<?php echo $product['href'];?>" target="_blank">

                <img src="<?php echo $product['thumb']; ?>" />

                <h3><?php echo $product['name']; ?></h3>

                <?php if (!$product['special']) { ?>

					<span class="price-new"><?php echo $product['price']; ?></span>

				<?php } else { ?>

					<span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo round($product['special'],2); ?></span>

				<?php } ?>

				<?php if($product['discount_per']!=0){ ?>

					<span>(<?php echo $product['discount_per'];?>%off)</span>

					<div><?php echo $product['discount_per'];?>%<br />off</div>

				<?php }?>

				</a>

            </div>

        <?php } ?>

	</div>

	<?php }?>

	<div id="tab_01" class="tab">

		<ul>

			<li style="background: url(catalog/view/theme/default/images/tab_03.png) repeat-x scroll 0% 0% transparent; border-width: medium 1px; border-style: none solid; border-color: -moz-use-text-color rgb(203, 217, 226); -moz-border-top-colors: none; -moz-border-right-colors: none; -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-image: none;"><?php echo $tab_description; ?></li>

			<?php if($attribute_groups){?>

				<li style="background: none repeat scroll 0% 0% transparent; border: medium none;"><?php echo $tab_attribute; ?></li>

			<?php }?>

			<?php if($casing){?>

				<li style="background: none repeat scroll 0% 0% transparent; border: medium none;">Casing</li>

			<?php }?>

                </ul>

                <dl>

			<dd style="display: block;"><?php echo $description; ?></dd>

			<?php if($attribute_groups){?>

			<dd style="display: none;">

                    		<table class="attribute">

					<?php foreach ($attribute_groups as $attribute_group) { ?>

					<thead>

						<tr>

							<td colspan="2"><?php echo $attribute_group['name']; ?></td>

						</tr>

					</thead>

					<tbody>

						<?php foreach ($attribute_group['attribute'] as $attribute) { ?>

						<tr>

							<td><?php echo $attribute['name']; ?></td>

							<td><?php echo $attribute['text']; ?></td>

						</tr>

						<?php } ?>

					</tbody>

					<?php } ?>

				</table>

			</dd>

			<?php }?>

			<?php if($casing){?>

			<dd style="display: none;">

				<?php echo $casing; ?>

			</dd>

			<?php }?>

                </dl>

	</div>

	<div id="tab_02" class="tab">

		<ul>

			<li style="background: url(catalog/view/theme/default/images/tab_03.png) repeat-x scroll 0% 0% transparent; border-width: medium 1px; border-style: none solid; border-color: -moz-use-text-color rgb(203, 217, 226); -moz-border-top-colors: none; -moz-border-right-colors: none; -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-image: none;"><?php echo $tab_review; ?></li>

			<li style="background: none repeat scroll 0% 0% transparent; border: medium none;"><?php echo $tab_qa; ?></li>

                </ul>

                <dl>

			<dd style="display: block;">

				<h2>

                        	<span>

                            		<?php echo $reviews; ?> :

				</span>

					<img src="catalog/view/theme/default/images/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />

                       		<button class="cursor_pointer" style="float:right;background:url(catalog/view/theme/default/images/btn_04.png);width:131px;height:30px" onclick="$('#write_review').show();">Write Reviews</button>

				</h2>

				<div style="display:none" id="write_review">

					<h2 id="review-title"><?php echo $text_write; ?></h2>

					<b><?php echo $entry_name; ?></b><br />

					<input type="text" name="name" value="" />

					<br />

					<br />

					<b><?php echo $entry_review; ?></b>

					<textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>

					<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />

					<br />

					<b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span>&nbsp;

					<input type="radio" name="rating" value="1" />

					&nbsp;

					<input type="radio" name="rating" value="2" />

					&nbsp;

					<input type="radio" name="rating" value="3" />

					&nbsp;

					<input type="radio" name="rating" value="4" />

					&nbsp;

					<input type="radio" name="rating" value="5" />

					&nbsp;<span><?php echo $entry_good; ?></span><br />

					<br />

					<b><?php echo $entry_captcha; ?></b><br />

					<input type="text" name="captcha" value="" />

					<br />

					<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />

					<br />

					<div class="buttons">

						<div class="right"><a id="button-review" class="button"><?php echo $button_continue; ?></a></div>

					</div>

				</div>

				<div id="review"></div>

			</dd>

			<dd style="display: none;"><h2>

                       		<button class="cursor_pointer" style="float:right;background:url(catalog/view/theme/default/images/btn_04.png);width:131px;height:30px" onclick="$('#write_qa').show();">Write Question</button>

				</h2>

				<div style="display:none" id="write_qa">

					<h2 id="qa-title"><?php echo $text_write; ?></h2>

					<b><?php echo $entry_name; ?></b><br />

					<input type="text" name="name_qa" value="" />

					<br />

					<br />

					<b><?php echo $entry_review; ?></b>

					<textarea name="text_qa" cols="40" rows="8" style="width: 98%;"></textarea>

					<span style="font-size: 11px;"><?php echo $text_note; ?></span><br />

					<br />

					

					<b><?php echo $entry_captcha; ?></b><br />

					<input type="text" name="captcha_qa" value="" />

					<br />

					<img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />

					<br />

					<div class="buttons">

						<div class="right"><a id="button-qa" class="button"><?php echo $button_continue; ?></a></div>

					</div>

				</div>

				<div id="qa"></div>

			</dd>

		</dl>

	</div>

</div>

<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script> 

<script type="text/javascript">

if ($.browser.msie && $.browser.version == 6) {

	$('.date, .datetime, .time').bgIframe();

}



$('.date').datepicker({dateFormat: 'yy-mm-dd'});

$('.datetime').datetimepicker({

	dateFormat: 'yy-mm-dd',

	timeFormat: 'h:m'

});

$('.time').timepicker({timeFormat: 'h:m'});

	$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

	$('#qa').load('index.php?route=product/product/qa&product_id=<?php echo $product_id; ?>');

	$('#button-review').bind('click', function() {

		$.ajax({

			url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',

			type: 'post',

			dataType: 'json',

			data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),

			beforeSend: function() {

				$('.success, .warning').remove();

				$('#button-review').attr('disabled', true);

				$('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');

			},

			complete: function() {

				$('#button-review').attr('disabled', false);

				$('.attention').remove();

			},

			success: function(data) {

				if (data['error']) {

					$('#review-title').after('<div class="warning">' + data['error'] + '</div>');

				}

				

				if (data['success']) {

					$('#review-title').after('<div class="success">' + data['success'] + '</div>');

									

					$('input[name=\'name\']').val('');

					$('textarea[name=\'text\']').val('');

					$('input[name=\'rating\']:checked').attr('checked', '');

					$('input[name=\'captcha\']').val('');

				}

			}

		});

	});

	$('#button-qa').bind('click', function() {

		$.ajax({

			url: 'index.php?route=product/product/writeQa&product_id=<?php echo $product_id; ?>',

			type: 'post',

			dataType: 'json',

			data: 'name=' + encodeURIComponent($('input[name=\'name_qa\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text_qa\']').val())  + '&captcha=' + encodeURIComponent($('input[name=\'captcha_qa\']').val()),

			complete: function() {

				$('#button-review').attr('disabled', false);

				$('.attention').remove();

			},

			success: function(data) {

				if (data['error']) {

					$('#qa-title').after('<div class="warning">' + data['error'] + '</div>');

				}

				

				if (data['success']) {

					$('#write_qa').hide();

					$('#qa-title').after('<div class="success">' + data['success'] + '</div>');

					

					$('input[name=\'name_qa\']').val('');

					$('textarea[name=\'text_qa\']').val('');

					$('input[name=\'captcha_qa\']').val('');

				}

			}

		});

	});

//--></script> 

    <script type="text/javascript"><!--

	$('#button-cart').bind('click', function() {

	$.ajax({

		url: 'index.php?route=checkout/cart/add',

		type: 'post',

		data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),

		dataType: 'json',

		success: function(json) {

			$('.success, .warning, .attention, information, .error').remove();

			

			if (json['error']) {

				if (json['error']['option']) {

					for (i in json['error']['option']) {

						$('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>');

					}

				}

			} 

			

			if (json['success']) {

				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');

					

				$('.success').fadeIn('slow');

					

				$('#cart-total').html(json['total']);

				

				$('html, body').animate({ scrollTop: 0 }, 'slow'); 

				window.location.href="index.php?route=checkout/cart";

			}	

		}

	});

});

//--></script>

<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>

<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<?php echo $footer; ?>